home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_08
/
9n08014c
< prev
next >
Wrap
Text File
|
1991-07-08
|
575b
|
22 lines
/* ldexp function */
#include "xmath.h"
double (ldexp)(double x, int xexp)
{ /* compute ldexp(x, xexp) */
switch (_Dtest(&x))
{ /* test for special codes */
case NAN:
errno = EDOM;
break;
case INF:
errno = ERANGE;
break;
case 0:
break;
default: /* finite */
if (0 <= _Dscale(&x, xexp))
errno = ERANGE;
}
return (x);
}